package cn.ickck.law_paper_final.provider;

import cn.ickck.law_paper_final.model.entity.CreditCardBatch;
import org.apache.ibatis.jdbc.SQL;

/**
 * @Author: ck
 * @Description: 信用卡批次更新
 * @Date: Create in 13:45 2020/10/27
 */
public class CreditCardBatchProvider {
    public String updateCreditCardBatch(final CreditCardBatch creditCardBatch)
    {
        return new SQL()
        {
            {
                UPDATE("credit_card_batch");
                if(creditCardBatch.getName()!=null)
                {
                    SET("name = #{name}");
                }
                if(creditCardBatch.getKey()!=null)
                {
                    SET("key =#{key}");
                }
                if(creditCardBatch.getDate()!=null)
                {
                    SET("date = #{date}");
                }
                if (creditCardBatch.getNum()!=null)
                {
                    SET("num = #{num}");
                }
                WHERE("id = #{id}");
            }

        }.toString();
    }
}
